package com.loveofsoftware.fotolab.effects;

import android.graphics.Bitmap;
import android.graphics.Camera;
import android.graphics.Matrix;

public class DepthAndRotate implements InitialEffects {

	float mDepthZ = 310;
	float deg = 45;

	public Bitmap transform(Bitmap in) {
		Matrix matrix = new Matrix();
		Camera camera = new Camera();
		camera.save();
		camera.translate(0.0f, 0.0f, mDepthZ);
		camera.rotateX(deg);
		camera.getMatrix(matrix);
		
		camera.restore();

		in = Bitmap.createBitmap(in, 0, 0, in.getWidth(), in.getHeight(),
				matrix, true);
		return in;
	}
}
